package com.zero.zeroframesample.ui

import com.blankj.utilcode.util.LogUtils
import com.drake.net.utils.scopeNetLife
import com.lxj.androidktx.core.toJson
import com.zero.zeroframe.popup.*
import com.zero.zeroframe.v.BaseActivity
import com.zero.zeroframesample.databinding.ActivitySplashBinding
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class SplashActivity : BaseActivity<ActivitySplashBinding>() {

    override fun ActivitySplashBinding.initView() {
        btn1.setOnClickListener {
            ImgPopup(getContext()) {
                LogUtils.e(it.toJson())
            }.show()
        }
        btn2.setOnClickListener {
            ConfirmPopup(getContext(), msg = "测试弹框1111111111111") {

            }.show()
        }

        btn3.setOnClickListener {
            LoadingPopup.show()
            scopeNetLife {
                delay(2000)
                launch {
                    LoadingPopup.hide()
                }
            }
        }
    }
}
